Adding a Modbus TCP/IP server to device tree

A “Modbus TCP/IP Server” instance can be added to any specific Ethernet interface/IP address. Each interface supports max. one instance of “Modbus TCP/IP Server”. Other protocols can be added in parallel.
-
Right click on ETH interface and click “Add object”.
The window “Add object below: ETH” appears.
-
Select “Modbus TCP/IP Server” and click “Add object”.
The node “Modbus_TCP_IP_Server” is added.
Setting the parameters of Modbus_TCP_IP_Server

Byte Order
Format/Endianess for the transmission of WORD values (register) within the request/response telegram (default: “Big Endian”).
Port
TCP port on which the server listens.
Startup Behaviour
This parameter specifies how the server behaves when configuration data is loaded (e.g. on download). It's default value is “Active”. This means the server is immediately addressable after configuration has been performed. In case the server should be activated later on during run time by means of function block ModTcpServOnOff this parameter value has to be set to “No activity”. Parameter Behaviour in state inactive then specifies the server's behaviour during the inactive phase.
Behaviour in state inactive
This parameter specifies how the server behaves in inactive state. This state may be set at the very beginning (parameter Startup Behaviour = “No activity”) and/or requested during run time calling function block ModTcpServOnOff. It's default value is “No activity”. This means the server is not addressable at all (no listening socket on TCP/IP) when it is inactive. Using this setting, any requests by Modbus TCP clients lead to the result Failed to connect to Server or Timeout. All other parameter values make the server respond with an exception code to any requests by Modbus TCP clients.
The presentation of the icon next to the “Modbus TCP/IP Server” in the device tree depends on the state of the server:

Attention:
Attention:
Exception code 9 is actually not defined by Modbus specification. This may cause problems using a different Modbus TCP client than AC500.
Disable
Parameter |
Default |
Value |
Description |
---|---|---|---|
Disable write to %MB from |
0 |
0 ... 65535 |
Disable write access starting at %MBx |
Disable write to %MB to |
0 |
0 ... 65535 |
Disable write access up to %MBx |
Disable read from %MB from |
0 |
0 ... 65535 |
Disable read access starting at %MBx |
Disable read from %MBx to |
0 |
0 ... 65535 |
Disable read access up at %MBx |
It is possible to disable read and/or write access to individual segments. Reading/writing is disabled beginning at the set start address and is valid up to the set end address (inclusive).